<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<%@include file="/WEB-INF/view/common/css.jsp"%>
<%@include file="/WEB-INF/view/common/systemcss.jsp"%>
</head>
<body>
<%-- 	<%@include file="/WEB-INF/view/common/system/header.jsp"%> --%>
	<div class="main">
	<table id="table"></table>
<div id="view1"></div>

		<%@include file="../common/pagehelper.jsp"%>
		<div id="page1"></div>

	</div>
	<div id="page3"></div>
					<div id="gridContainer_2_2_2" class="dlshouwen-grid-container"></div>
				<div id="gridToolBarContainer_2_2_2" class="dlshouwen-grid-toolbar-container"></div>

	
	
	
	<script type="text/javascript">
	//以下将以jquery.ajax为例，演示一个异步分页
	/* function demo(curr){
	  $.getJSON('list', {
	  page: curr || 1 //向服务端传的参数，此处只是演示
	  }, function(res){
	  //此处仅仅是为了演示变化的内容
// 	  var demoContent = (new Date().getTime()/Math.random()/1000)|0;
// 	  document.getElementById('view1').innerHTML = res.content + demoContent;
		$("#table").empty();
		var html = ""
		for(var i = 0 ;i<res.list.length;i++){
			console.log(res.list[i].createtime);
			html += "<tr>" 
			html += "<td>"+ res.list[i].id + "</td>";
			html += "<td>"+ res.list[i].userid + "</td>";
			html += "<td>"+ res.list[i].createtime + "</td>";
			html += "</tr>";
		}
		console.log(html)
		$("#table").append(html);
		

	  //显示分页
	  
	  
	  console.log(res.list)
	  laypage({
	    cont: 'page1', //容器。值支持id名、原生dom对象，jquery对象。【如该容器为】：<div id="page1"></div>
	    pages: res.pages, //通过后台拿到的总页数
	    curr: curr || 1, //当前页
	    jump: function(obj, first){ //触发分页后的回调
	    if(!first){ //点击跳页触发函数自身，并传递当前页：obj.curr
	      demo(obj.curr);
	    }
	    }
	  });
	  });
	};
	//运行
	demo();
 */	
	</script>
	
	
	<script type="text/javascript">
	var gridColumns_2_2_2 = [
	                     	{id:'userid', title:'用户编号', type:'string', columnClass:'text-center', fastQuery:true, fastQueryType:'eq'},
	                     	{id:'storename', title:'门店名称', type:'string',  columnClass:'text-center', hideType:'sm|xs', fastQuery:true, fastQueryType:'eq' },
	                     	{id:'createtime', title:'用户名称', type:'string', columnClass:'text-center', fastQuery:true, fastQueryType:'lk'},
	                     	{id:'redtime', title:'秒级时间戳', type:'date', format:'yyyy-MM-dd',oformat:'yyyy-MM-dd', otype:'time_stamp_s', columnClass:'text-center', fastQuery:true, fastQueryType:'range' }
	                     	/* {id:'sex', title:'性别', type:'string', codeTable:sex, columnClass:'text-center', hideType:'xs', fastQuery:true, fastQueryType:'eq', resolution:function(value, record, column, grid, dataNo, columnNo){
	                     		var content = '';
	                     		if(value==1){
	                     			content += '<span style="background:#00a2ca;padding:2px 10px;color:white;">Male</span>';
	                     		}else{
	                     			content += '<span style="background:#c447ae;padding:2px 10px;color:white;">Female</span>';
	                     		}
	                     		return content;
	                     	}},
	                     	{id:'salary', title:'薪水', type:'number', format:'#,###.00', columnClass:'text-center', hideType:'xs', fastQuery:true, fastQueryType:'range'},
	                     	{id:'time', title:'日期对象', type:'date', format:'yyyy-MM-dd hh:mm:ss', columnClass:'text-center', hideType:'md|sm|xs', fastQuery:true, fastQueryType:'range' },
	                     	{id:'time_stamp_ms', title:'毫秒级时间戳', type:'date', format:'yyyy-MM-dd hh:mm:ss', otype:'time_stamp_ms S', columnClass:'text-center', hideType:'lg|md|sm|xs', fastQuery:true, fastQueryType:'range' },
	                     	{id:'string_date', title:'日期格式字符串', type:'date', format:'yyyy-MM-dd', otype:'string', oformat:'yyyy-MM-dd', columnClass:'text-center', hideType:'lg|md|sm|xs', fastQuery:true, fastQueryType:'range' },
	                     	{id:'string_time', title:'时间格式字符串', type:'date', format:'yyyy-MM-dd hh:mm:ss', otype:'string', oformat:'yyyy-MM-dd hh:mm:ss', columnClass:'text-center', hideType:'lg|md|sm|xs', fastQuery:true, fastQueryType:'range' }
	                      */];
	                     var gridOption_2_2_2 = {
	                     	lang : 'zh-cn',
	                     	ajaxLoad : true,
	                     	loadURL : 'list',
	                     	exportFileName : '用户列表',
	                     	columns : gridColumns_2_2_2,
	                     	gridContainer : 'gridContainer_2_2_2',
// 	                     	toolbarContainer : 'gridToolBarContainer_2_2_2',
	                     	tools : '',
	                     	pageSize : 10,
	                     	pageSizeLimit : [10, 20, 50]
	                     };
	                     var grid_2_2_2 = $.fn.dlshouwen.grid.init(gridOption_2_2_2);
	                     $(function(){
	                     	grid_2_2_2.load();
	                     });
	
	</script>
</body>
</html>